#include "StdAfx.h"
#include "DDsFileHeaderFactory.h"
namespace dds
{
CDDsFileHeaderFactory::CDDsFileHeaderFactory(void)
{
	m_pDdsfileHeader = 0;
}

CDDsFileHeaderFactory::~CDDsFileHeaderFactory(void)
{
	if( m_pDdsfileHeader != NULL )
	{

		delete m_pDdsfileHeader;
	}
}

CDdfFileHeader * CDDsFileHeaderFactory::CreateHeader( int ntype )
{


	m_nType = ntype;

	if( m_nType <= 1 )
	{
		m_pDdsfileHeader = new dds::CDdf01FileHeader();
	}
	else if(m_nType == 2 )
	{
		m_pDdsfileHeader = new dds::CDdf02FileHeader();
	}
	else if( m_nType == 3 )
	{
		m_pDdsfileHeader = new dds::CDdf03FileHeader();
	}
	else if( m_nType == 4 )
	{
		m_pDdsfileHeader = new dds::CDdf04FileHeader();


	}
	return m_pDdsfileHeader;

}

}
